<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>文章列表--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="resources/css/public.css" media="all" />
</head>
<body class="childrenBody">
<form class="layui-form">
    <blockquote class="layui-elem-quote quoteBox">
        <form class="layui-form">
            <div class="layui-inline">
                <div class="layui-input-inline">
                    <input type="text" class="layui-input searchVal" placeholder="请输入搜索的内容" />
                </div>
                <a class="layui-btn search_btn" data-type="reload">搜索</a>
            </div>
            <!--<div class="layui-inline">
                <a class="layui-btn layui-btn-normal addNews_btn">添加文章</a>
            </div>-->
            <div class="layui-inline">
                <a class="layui-btn layui-btn-danger layui-btn-normal delAll_btn">批量删除</a>
            </div>
        </form>
    </blockquote>
    <table id="permissionList" lay-filter="newsList"></table>
    <!--审核状态-->
    <script type="text/html" id="newsStatus">
        {{#  if(d.newsStatus == "1"){ }}
        <span class="layui-red">等待审核</span>
        {{#  } else if(d.newsStatus == "0"){ }}
        <span class="layui-blue">已存草稿</span>
        {{#  } else { }}
        审核通过
        {{#  }}}
    </script>

    <!--操作-->
    <script type="text/html" id="perListBar">
       <!-- <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
        <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="look">预览</a>-->
    </script>
</form>
<script type="text/javascript" src="resources/layui/layui.js"></script>
<script type="text/javascript" th:inline="none">
    layui.use(['form','layer','table','laytpl'],function(){
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laytpl = layui.laytpl,
            table = layui.table;
//权限列表
        var tableIns = table.render({
            elem: '#permissionList',//获取到上面的表单
            url : 'permissions',//发送到后端控制器中的位置
            cellMinWidth : 95,
            page : true,
            height : "full-125",
            limits : [2,10,15,20,25],
            limit : 20,
            id : "permissionListTable",
            cols : [[
                {type: "checkbox", fixed:"left", width:50},
                {field: 'name', title: '权限', minWidth:100, align:"center"},
               /* {title: '操作', minWidth:175, templet:'#perListBar',fixed:"right",align:"center"}*/
            ]]
        });

        //实现搜索功能
        $(".search_btn").click(function () {
            var name=$(".searchVal").val();
            //alert("这是："+name)
            table.reload('permissionListTable',{url:"permissions?name="+name});
        });

    })
</script>
</body>
</html>